<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      class Animal {
        // Animal.prototype = function say
        say() {
          console.log("hello ...");
        }
      }
      class Cat extends Animal {}
      class TomCat extends Cat {}

      const tc = new TomCat();
      tc.say();

      console.log(tc.__proto__ === TomCat.prototype);
      console.log(TomCat.prototype.__proto__ === Cat.prototype);
      console.log(Cat.prototype.__proto__ === Animal.prototype);
    </script>
  </body>
</html>
